#ifndef LOGGER_H
#define LOGGER_H

#include <string>
#include <vector>

#include "boost_filesystem.h"

// Define (or don't define) USE_LOG to determine if LOG calls do anything.
#ifdef USE_LOG
    #define LOG(string) Logger::Get().Log(string)
#else
    #define LOG(string)
#endif

// Singleton designed to log application and game details to
// aid in difficult bugs and errors.
class Logger
{
public:
	static void initialise(const boost_path& fileName);

	static Logger& get();

	void log(const std::string& str);
	void saveLog();
private:
	typedef std::vector<std::string>::iterator bufferIt;
	typedef std::vector<std::string>::const_iterator constBufferIt;
	static Logger instance;
	static bool initialised;

	boost_path fileName;
	std::vector<std::string> buffer;
};

#endif